#include "bits/stdc++.h"
using namespace std;
using ll = long long;
const int N = 10009; //1e5+5//100005

ll n,s;
ll c,y;
ll tmp,ans;
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0),cout.tie(0);
	cin >> n >> s;
	for(int i=1;i<=n;i++)
	{
		cin >> c >> y;
		if(i==1)
			tmp = c;
		else
			tmp = min(c,tmp+s);		
		ans += y*tmp;
	}
	cout << ans;
	return 0;
}
